/**
 * @title HHSearchForm.java 
 * @description 	搜索表单验证类	
 * @create 			2012-8-13 下午4:56:56 By xjiujiu
 * @package 		apps.admin.form
 * @copyright 		Copyright (c) 2011-2012 http://xyrj.hhtc.edu.cn.com. All right reserved
 * @version         $Id$
 * XYRJ-Java-Project
 */

package apps.admin.form;

import com.xyrj.core.HHObject;
import com.xyrj.core.HHPojo;
import com.xyrj.core.IHHForm;
import com.xyrj.exception.HHValidateException;
import com.xyrj.mvc.HHView;
import com.xyrj.utils.HHVerify;

/** 
 * 验证搜索表单 
 * 
 * @description
 * 
 * @classname 	HHSearchForm 
 * @author 		xjiujiu<xjiujiu@foxmail.com>
 * @date 		2012-8-13 下午4:56:56 
 * @version 	1.0
 */
public class HHSearchForm extends HHObject implements IHHForm
{

	/* (非 Javadoc) 
	 * <p>{point}</p>
	 * 
	 * <p>description: </p> 
	 *
	 * @title validate 
	 * @param pojo
	 * @throws HHValidateException 
	 * @see com.xyrj.core.IHHForm#validate(com.xyrj.core.HHPojo) 
	 */
	@Override
	public void validate(HHPojo pojo) throws HHValidateException
	{
		// TODO Auto-generated method stub
	}

	/* (非 Javadoc) 
	 * <p>验证搜索表单是否合法</p>
	 * 
	 * <p>description: </p> 
	 *
	 * @title validate 
	 * @param view
	 * @throws HHValidateException 
	 * @see com.xyrj.core.IHHForm#validate(com.xyrj.mvc.HHView) 
	 */
	@Override
	public void validate(HHView view) throws HHValidateException
	{
		String keyword 	= view.getParameter("keyword");
		if(HHVerify.isEmpty(keyword) ||
			keyword.equals("请输入关键字...")) {
			throw new HHValidateException("搜索关键字不能为空！");
		}
	}

}
